//
//  CSHomeSlideCollectionViewCell.m
//  ChinaShip
//
//  Created by Yale on 2019/1/24.
//  Copyright © 2019年 ChinaShip. All rights reserved.
//

#import "CSHomeSlideCollectionViewCell.h"
@interface CSHomeSlideCollectionViewCell()
{
    IBOutlet UIImageView *showImageView;
    IBOutlet UILabel *titleLabel;
    IBOutlet NSLayoutConstraint *heightLayoutConstraint;
}
@end
@implementation CSHomeSlideCollectionViewCell

- (void)setCoverImage:(NSString *)imgName title:(NSString *)title{
    showImageView.image = [UIImage imageNamed:imgName];
    titleLabel.text = title;
}

- (void)setCoverImageURL:(NSString *)imgURL title:(NSString *)title{
    [showImageView sd_setImageWithURL:[NSURL URLWithString:imgURL]];
    titleLabel.text = title;
}



- (void)setSecondDetailStyle{
    [self setUpStyle];
    heightLayoutConstraint.constant = 80;
    heightLayoutConstraint.priority = 999;
    titleLabel.font = [UIFont boldSystemFontOfSize:15];
    [self layoutIfNeeded];
}

- (void)setSectionListStyleWithImgURL:(NSString *)url title:(NSString *)title{
    titleLabel.font = [UIFont boldSystemFontOfSize:13];
    heightLayoutConstraint.constant = 54;
    heightLayoutConstraint.priority = 1000;
    [self layoutIfNeeded];
    [self setUpStyle];
    [self setCoverImageURL:url title:title];
}


- (void)setUpStyle{
    self.layer.masksToBounds = NO;
    self.layer.contentsScale = [UIScreen mainScreen].scale;
    self.layer.shadowOpacity = 0.4f;
    self.layer.shadowRadius = 3.0f;
    self.layer.shadowOffset = CGSizeMake(0,2);
    self.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.bounds].CGPath;
    //设置缓存
    self.layer.shouldRasterize = YES;
    //设置抗锯齿边缘
    self.layer.rasterizationScale = [UIScreen mainScreen].scale;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

@end
